proc muc:users {conf args} {
	
		set useconf 1
	foreach {attr val} $args {
		switch -- $attr {
			-command {set usecmd 1; set cmd $val}
			-noconf {set useconf 0}
		}
	}
	if {$conf!="" && $useconf=="1" && $usecmd!=""} {
		set data [wrapper:createtag query -vars [list xmlns "http://jabber.org/protocol/disco#items" node http://jabber.org/protocol/commands]]
		set a 1
	} elseif {$conf!="" && $useconf=="0" && $usecmd!=""} {
		set data [wrapper:createtag query -vars [list xmlns "http://jabber.org/protocol/disco#items"]]
		set a 1
	}
	if {$a=="1"} {
		jlib::send_iq get $data -to $conf -command "users_parse -command \"$cmd\""
	}
}
proc users_parse {args} {

	foreach {attr val} $args {
		switch -- $attr {
			-command {set usecmd 1; set cmd $val}
		}
	}
	
	set l [llength $args]
	if {[lindex $args [expr $l-1]]!="ERR"} {
		set child [lindex $args end]
		wrapper:splitxml $child tag vars isempty chdata children
		foreach item $child {
			if {$tag=="query"} {
				if {[wrapper:getattr $vars xmlns]=="http://jabber.org/protocol/disco#items"} {
					foreach item $children {
						wrapper:splitxml $item itag ivars iisempty ichdata ichildren
						append a [wrapper:getattr $ivars name]
						append a " \[[wrapper:getattr $ivars jid]\]"
						lappend result $a
						unset item ivars itag iisempty ichdata ichildren a
					}
					eval "$cmd [list $result]"
					return
				}
			}
		}
	}
}